#include "ksvgsavetask.h"
#include "ksvgfilemanager.h"

KSvgSaveTask::KSvgSaveTask(const QString& filePath,
    const QList<KExportShape*>& shapeList,
    const QRectF& sceneRect,
    const QColor& bgColor)
    : m_filePath(filePath), m_shapeList(shapeList),
    m_sceneRect(sceneRect), m_bgColor(bgColor)
{
    setAutoDelete(true);
}

void KSvgSaveTask::run()
{
    bool ok = KSvgFileManager::saveSvgFile(m_filePath, m_shapeList, m_sceneRect, m_bgColor);
    emit saveFinished(m_filePath, ok, m_shapeList.size());
}
